<?php
Template::AddJs("picnet.table.filter.min");
Template::AddJs("jquery.tablesorter.min");
Template::AddCss("tablesorter/style");
?>
<script type="text/javascript">
$(function() {
  $("#student-records").tablesorter({ 
        headers: {
            6: { 
                sorter: false 
            },
            7: { 
                sorter: false 
            }
        } 
    }); 
  $('#student-records').tableFilter();
  $(".delete-reminder").click(function(){
    var ans = confirm("Are you sure you want to delete this reminder?");
    if (ans != true)
      return false;
  });
});
</script>
<a href="?q=reminders/create">Create Reminder</a> - <a href="calendar/icalendar.php">Download vCal</a>
<table id="student-records" class="tablesorter records">
  <thead>
  <tr>
      <th>ID</th>
      <th>Name</th>
      <th filter-type="ddl">Class</th>
      <th filter-type="ddl">College</th>
      <th>Email</th>
      <th>Reminder Date</th>
      <th>Note</th>
      <th filter="false">Action</th>
    </tr>
  </thead>
  <tbody>
  <?php foreach ($reminders as $reminder): $index = ++$t - 1; if ($reminder["status"] != "okay" || $reminder["user"] != $_SESSION["username"]) continue; ?>
  <tr>
    <td><?php echo $reminder->id; ?></td>
    <td><?php echo "$reminder->last, $reminder->first"; ?></td>
    <td><?php echo $reminder->class; ?></td>
    <td><?php echo $reminder->college; ?></td>
    <td><?php echo $reminder->email; ?></td>
    <td><?php echo $reminder->reminder_date; ?></td>
    <td><?php echo $reminder->note; ?></td>
    <td><a href="?q=reminders/create/<?php echo $index; ?>">Edit</a> <a class="delete-reminder" href="?q=reminders/delete/<?php echo $index; ?>">Delete</a></td>
  </tr>
  <?php endforeach; ?>
  </tbody>
</table>
